﻿using CloudMusic.Model;
using CloudMusic.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CloudMusic.UC
{
    /// <summary>
    /// UCStore.xaml 的交互逻辑
    /// </summary>
    public partial class UCStore : UserControl
    {
        public UCStore()
        {
            InitializeComponent();
        }

        private void storeToList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int i = storeToList.SelectedIndex;
            storeToList.SelectedIndex = i;
            if (storeToList.SelectedIndex != -1)
            {
                StoreListModel music = (StoreListModel)storeToList.SelectedValue;
                var vm = DataContext as MainWindowViewModel;
                long id = vm.selectedMusic.Id;
                if (id > 0)
                {
    
                }
                //MessageBox.Show(id.ToString() + " : " + music.id.ToString());
            }
            if (storeToList.SelectedIndex == -1) return;
            storeToList.SelectedIndex = -1;

        }
        // public static event EventHandler UCStoreClose;  
    }
}
